|
|
|
|
|
|
|
Chapter 9
Advanced Animation |
|
|
|
|
|
|
|
|
The previous chapter describes methods for adding animation to your programs. It explains how to present images at regular intervals to produce the illusion of smooth motion. |
|
|
|
|
|
|
|
|
This chapter describes ways a program can determine what is displayed by the animation. It uses the concepts of simulation, scripting, and sprites to determine how animation should work. It explains methods for generating animation sequences, including tweening and morphing, a technique that uses image processing methods to produce fascinating animated sequences. |
|
|
|
|
|
|
|
|
This chapter also explains a variety of scene transition effects. Using these techniques, you can add extra interest to even the simplest graphical programs. |
|
|
|
|
|
|
|
|
When you create the frames for a bitmap animation, you determine the exact color of each pixel in every frame. When your program creates frames as it runs, you need some method to control the way in which the program generates the frames. The sections that follow describe two important methods for controlling animation: simulation and scripting. |
|
|
|
|
|
|
|
|
In a simulation, a program uses a set of rules to determine how objects in the animation behave over time. In many programs, the rules are based on the physical laws of the universe. These laws include those that describe falling objects, elastic collisions, the force of gravity between objects, and the way water flows through pipes. Often these laws are greatly simplified to make calculations faster. If the calculations between frames take too long, the program cannot display the frames quickly enough to produce the illusion of smooth motion. |
|
|
|
|
|